
import queue
import requests
import json
import time

write_file = open("forTest.txt", "a+")

listOne=[]
listOne.append("https://static-data.eol.cn/www/2.0/school/102/dic/specialplan.json")


for link in listOne:
    data= requests.get(link.replace('\n',''))

    body = json.loads(data.text)
    if isinstance(body, dict):

        Lists = body["data"]["data"]
        print(Lists[0])

        for listone in Lists:
            # print(type(listone))
            year = listone["year"]
            province=listone["province"]
            print(year)
            # print(type(province))

            for i in province:
                # print(type(i))
                pid=i["pid"]
                type=i["type"]
                batch=i["batch"]
                schoolId="102"
                print(pid)
                print(type)
                print(batch)
                for ty in type:
                    for bat in batch:
                        url="https://static-data.eol.cn/www/2.0/schoolplanindex/"+str(year)+"/"+schoolId+"/"+str(pid)+"/"+str(ty)+"/"+str(bat)+"/1.json"
                        write_file.write(url+'\n')




